<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var num=10;
    var obj={num:20};
    obj.fn=(function (num) {
        this.num=num*3;
        num++;
        return function (n) {
            this.num+=n;
            num++;
            console.log(num);
        }
    })(obj.num);
    var fn=obj.fn;
    fn(5);
    obj.fn(10);
    console.log(obj.num,num)
</script>
</body>
</html>